#include "RenderStatisticPanel.h"

#include "Core/GlobalContext.h"

namespace SE
{
	void RenderStatisticPanel::onRender(const Double deltaMilliseconds)
	{
		auto renderContext = GlobalContext::GetRenderContext();
		ImGui::Begin("Statistics");
		ImGui::Text("FPS: %d", I32(1000.0 / deltaMilliseconds));
		ImGui::Text("Draw calls: %d", renderContext->drawCalls);
		ImGui::Text("Triangle count: %d", renderContext->triangleIndex);
		ImGui::Text("Quad count: %d", renderContext->quadIndex);
		ImGui::End();
		RenderAPI::ResetStats();
	}

	String RenderStatisticPanel::getName() const
	{
		return "Render Statistic Panel";
	}
} // !namespace SE